<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  

  
  <title>Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta property="og:type" content="website">
<meta property="og:title" content="Hexo">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:locale" content="中文">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Hexo">
  
    <link rel="alternate" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
</head>
</html>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main">
  
    <article id="post-XJIOTKit-使用" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/04/12/XJIOTKit-使用/" class="article-date">
  <time datetime="2019-04-12T02:28:28.000Z" itemprop="datePublished">2019-04-12</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/04/12/XJIOTKit-使用/">XJIOTKit 使用</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="XJIOTKit-使用"><a href="#XJIOTKit-使用" class="headerlink" title="XJIOTKit 使用"></a>XJIOTKit 使用</h2><h6 id="version-0-2-25"><a href="#version-0-2-25" class="headerlink" title="version: 0.2.25"></a>version: 0.2.25</h6><h4 id="导入SDK"><a href="#导入SDK" class="headerlink" title="导入SDK"></a>导入SDK</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">pod &apos;XJIOTKit&apos;</span><br><span class="line"></span><br><span class="line"># XJIOTUtil 可选 集成了几种配网工具 乐鑫(ESPTouch)、庆科(EasyLink)、aws</span><br><span class="line">pod &apos;XJIOTUtil&apos;</span><br></pre></td></tr></table></figure>
<h4 id="初始化"><a href="#初始化" class="headerlink" title="初始化"></a>初始化</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[XJIOTKitApi startWithDevelopKey:APP_DEVELOP_KEY developSecret:APP_DEVELOP_SECRET source:APP_Source];</span><br></pre></td></tr></table></figure>
<h4 id="获取到-userId-后兑换-userSecret"><a href="#获取到-userId-后兑换-userSecret" class="headerlink" title="获取到 userId 后兑换 userSecret"></a>获取到 userId 后兑换 userSecret</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[XJIOTKitApi userSecretIfNeedWithUserId:userId response:^(BOOL userInvalid, NSString *userSecret, NSError *error) &#123;</span><br><span class="line"></span><br><span class="line">&#125;];</span><br></pre></td></tr></table></figure>
<h4 id="启动-XJDeviceManager"><a href="#启动-XJDeviceManager" class="headerlink" title="启动 XJDeviceManager"></a>启动 XJDeviceManager</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[XJDeviceManager shared].dataSource = self; // 设置数据源代理</span><br><span class="line">[[XJDeviceManager shared] startWithUserId:userId];</span><br></pre></td></tr></table></figure>
<h4 id="启动-XJMQTTManager"><a href="#启动-XJMQTTManager" class="headerlink" title="启动 XJMQTTManager"></a>启动 XJMQTTManager</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">[[XJMQTTManager sharedInstanced] connectWithUserId:userId userSecret:userSecret developKey:APP_DEVELOP_KEY result:^(NSError *error) &#123;</span><br><span class="line">        if (error) &#123;</span><br><span class="line">            NSLog(@&quot;mqtt Error [%@]&quot;, error.description);</span><br><span class="line">        &#125;</span><br><span class="line">&#125;];</span><br></pre></td></tr></table></figure>
<h4 id="建立设备模型"><a href="#建立设备模型" class="headerlink" title="建立设备模型"></a>建立设备模型</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">/** 电风扇设备 属性字段名要求与协议上定义的一致 */</span><br><span class="line">@interface FanDevice : XJDevice</span><br><span class="line"></span><br><span class="line">/// 电源开关</span><br><span class="line">@property (nonatomic, strong) XJDeviceValue *PowerSwitch;</span><br><span class="line">/// 风速</span><br><span class="line">@property (nonatomic, strong) XJDeviceValue *Speed;</span><br><span class="line"></span><br><span class="line">@end</span><br></pre></td></tr></table></figure>
<h4 id="完成数据源代理-XJDeviceManagerDataSource"><a href="#完成数据源代理-XJDeviceManagerDataSource" class="headerlink" title="完成数据源代理 XJDeviceManagerDataSource"></a>完成数据源代理 XJDeviceManagerDataSource</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">#pragma mark - XJDeviceManagerDataSource</span><br><span class="line"></span><br><span class="line">- (Class)deviceManager:(XJDeviceManager *)manager subDeviceClassWithProductKey:(NSString *)productKey &#123;</span><br><span class="line">	if ([productKey isEqualToString:@&quot;abcdefg&quot;])</span><br><span class="line">	    return FanDevice.class;</span><br><span class="line">	...</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h4 id="下发控制"><a href="#下发控制" class="headerlink" title="下发控制"></a>下发控制</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">/// 设备列表获取的设备 _device</span><br><span class="line"></span><br><span class="line">/// 下发风速控制为1档</span><br><span class="line">[_device sendControlWithKey:@&quot;Speed&quot; value:@&quot;1&quot; certainDeliver:YES result:^(uint32_t msgID, BOOL delivered, NSError * _Nullable error) &#123;</span><br><span class="line">	if (delivered) &#123; /// 下发成功</span><br><span class="line">	</span><br><span class="line">	&#125;</span><br><span class="line">&#125;];</span><br></pre></td></tr></table></figure>
<h4 id="设备列表变化和设备状态变化"><a href="#设备列表变化和设备状态变化" class="headerlink" title="设备列表变化和设备状态变化"></a>设备列表变化和设备状态变化</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><span class="line">//设备列表</span><br><span class="line">XJDeviceManager.shared.devices</span><br><span class="line"></span><br><span class="line">// 设备列表和设备状态改变的代理</span><br><span class="line">XJDeviceManagerDelegate</span><br><span class="line"></span><br><span class="line">example:</span><br><span class="line"></span><br><span class="line">#pragma mark - XJDeviceManagerDelegate</span><br><span class="line"></span><br><span class="line">- (void)deviceManager:(XJDeviceManager *)manager didChange:(__kindof XJDevice *)device isNew:(BOOL)isNew atIndex:(NSUInteger)index &#123;</span><br><span class="line">    if (isNew) &#123; /// 设备列表增加了设备</span><br><span class="line">        [self.collectionView performBatchUpdates:^&#123;</span><br><span class="line">            if (index == 0) &#123; // 没有数据源的时候不能调用 insertItemsAtIndexPaths</span><br><span class="line">                [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:XJMainDeviceSectionDevice]];</span><br><span class="line">            &#125; else &#123;</span><br><span class="line">                [self.collectionView insertItemsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:XJMainDeviceSectionDevice]]];</span><br><span class="line">            &#125;</span><br><span class="line">        &#125; completion:^(BOOL finished) &#123;</span><br><span class="line"></span><br><span class="line">        &#125;];</span><br><span class="line">        </span><br><span class="line">    &#125; else &#123; ///设备状态发生了变化</span><br><span class="line">        XJMainDeviceCollectionViewCell *cell = (XJMainDeviceCollectionViewCell *)[self.collectionView cellForItemAtIndexPath:[NSIndexPath indexPathForRow:index inSection:XJMainDeviceSectionDevice]];</span><br><span class="line">        [self configCell:cell forDevice:device];</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">- (void)deviceManager:(XJDeviceManager *)manager didRemove:(NSArray&lt;__kindof XJDevice *&gt; *)devices atIndexSet:(NSIndexSet *)indexSet &#123;</span><br><span class="line">    [self.collectionView performBatchUpdates:^&#123;</span><br><span class="line">        [self.collectionView deleteItemsAtIndexPaths:[manager indexPathsWithIndexSet:indexSet inSection:XJMainDeviceSectionDevice]];</span><br><span class="line">    &#125; completion:^(BOOL finished) &#123;</span><br><span class="line"></span><br><span class="line">    &#125;];</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/04/12/XJIOTKit-使用/" data-id="cjujetss200011lrjd1qkra57" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/XJIOTKit/">XJIOTKit</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/iOS/">iOS</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/xjiang/">xjiang</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/使用文档/">使用文档</a></li></ul>

    </footer>
  </div>
  
</article>


  
    <article id="post-新用户注册推送到中心" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/04/11/新用户注册推送到中心/" class="article-date">
  <time datetime="2019-04-11T10:18:13.000Z" itemprop="datePublished">2019-04-11</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/04/11/新用户注册推送到中心/">新用户注册推送到中心</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p><strong>简要描述：</strong> </p>
<ul>
<li>新用户注册，生成用户密钥，且username+source唯一</li>
</ul>
<p><strong>请求URL：</strong> </p>
<ul>
<li><code>https://platform.xjiangiot.com/api/user/register</code></li>
</ul>
<p><strong>请求方式：</strong></p>
<ul>
<li>POST </li>
</ul>
<p><strong>请求头部：</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">参数</th>
<th style="text-align:left">必选</th>
<th style="text-align:left">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">api-token</td>
<td style="text-align:left">是</td>
<td style="text-align:left">string</td>
<td>访问token</td>
</tr>
</tbody>
</table>
<p><strong>参数：</strong> </p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">必选</th>
<th style="text-align:left">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">username</td>
<td style="text-align:left">是</td>
<td style="text-align:left">string</td>
<td>用户名</td>
</tr>
<tr>
<td style="text-align:left">password</td>
<td style="text-align:left">是</td>
<td style="text-align:left">string</td>
<td>密码</td>
</tr>
<tr>
<td style="text-align:left">source</td>
<td style="text-align:left">是</td>
<td style="text-align:left">string</td>
<td>开发者注册时获取</td>
</tr>
</tbody>
</table>
<p> <strong>返回示例</strong><br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  &quot;code&quot;: 1000,</span><br><span class="line">  &quot;msg&quot;: &quot;ok&quot;,</span><br><span class="line">  &quot;data&quot;: &#123;</span><br><span class="line">    &quot;userId&quot;: &quot;fkkkskfjfasfjskjfkjfkjfkjskfjksjfksf&quot;//用户唯一标识，长度为32位</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p> <strong>备注</strong> </p>
<ul>
<li>更多返回错误代码请看首页的错误代码描述</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/04/11/新用户注册推送到中心/" data-id="cjujetssa00051lrjexwuyt50" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
</article>


  
    <article id="post-开发者账号秘钥验证，并获取token" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/04/11/开发者账号秘钥验证，并获取token/" class="article-date">
  <time datetime="2019-04-11T10:17:42.000Z" itemprop="datePublished">2019-04-11</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/04/11/开发者账号秘钥验证，并获取token/">开发者账号秘钥验证，并获取token</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p><strong>简要描述：</strong> </p>
<ul>
<li>开发者账号秘钥验证，并获取token</li>
</ul>
<p><strong>请求URL：</strong> </p>
<ul>
<li><code>https://platform.xjiangiot.com/api/develop/token</code></li>
</ul>
<p><strong>请求方式：</strong></p>
<ul>
<li>POST</li>
</ul>
<p><strong>参数：</strong> </p>
<table>
<thead>
<tr>
<th style="text-align:left">参数名</th>
<th style="text-align:left">必选</th>
<th style="text-align:left">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">developerKey</td>
<td style="text-align:left">是</td>
<td style="text-align:left">string</td>
<td>开发者KEY</td>
</tr>
<tr>
<td style="text-align:left">developerSecret</td>
<td style="text-align:left">是</td>
<td style="text-align:left">string</td>
<td>开发者秘钥</td>
</tr>
</tbody>
</table>
<p> <strong>返回示例</strong><br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  &quot;code&quot;: 1000,</span><br><span class="line">  &quot;msg&quot;: &quot;ok&quot;,</span><br><span class="line">  &quot;data&quot;: &#123;</span><br><span class="line">      &quot;access_token&quot;:&quot;fjksjjakjljkjkkkkkjdkfjskjaljkjfk&quot;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p> <strong>备注</strong> </p>
<ul>
<li>更多返回错误代码请看首页的错误代码描述</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/04/11/开发者账号秘钥验证，并获取token/" data-id="cjujetss900041lrjntnrawq6" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
</article>


  
    <article id="post-小匠云平台物联网开发套件iotkit（Android）使用手册" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/04/11/小匠云平台物联网开发套件iotkit（Android）使用手册/" class="article-date">
  <time datetime="2019-04-11T10:09:49.000Z" itemprop="datePublished">2019-04-11</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/04/11/小匠云平台物联网开发套件iotkit（Android）使用手册/">小匠云平台物联网开发套件iotkit（Android）使用手册</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="小匠云平台物联网开发套件iotkit（Android）使用手册"><a href="#小匠云平台物联网开发套件iotkit（Android）使用手册" class="headerlink" title="小匠云平台物联网开发套件iotkit（Android）使用手册"></a>小匠云平台物联网开发套件iotkit（Android）使用手册</h2><h3 id="在项目中添加依赖"><a href="#在项目中添加依赖" class="headerlink" title="在项目中添加依赖"></a>在项目中添加依赖</h3><figure class="highlight groovy"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">implementation <span class="string">'com.google.protobuf:protobuf-lite:3.0.0'</span></span><br><span class="line">implementation <span class="string">'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0'</span></span><br><span class="line">implementation <span class="string">'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'</span></span><br><span class="line">implementation <span class="string">'com.squareup.retrofit2:retrofit:2.5.0'</span></span><br><span class="line">implementation <span class="string">'com.squareup.retrofit2:converter-gson:2.5.0'</span></span><br><span class="line">implementation <span class="string">'com.squareup.okhttp3:logging-interceptor:3.12.0'</span></span><br><span class="line">implementation <span class="string">'io.fogcloud.sdk:easylinkv3:0.2.6'</span></span><br></pre></td></tr></table></figure>
<h3 id="在AndroidManifest-xml中配置"><a href="#在AndroidManifest-xml中配置" class="headerlink" title="在AndroidManifest.xml中配置"></a>在AndroidManifest.xml中配置</h3><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- Mqtt Service --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">service</span> <span class="attr">android:name</span>=<span class="string">"org.eclipse.paho.android.service.MqttService"</span>/&gt;</span></span><br><span class="line"><span class="comment">&lt;!-- 需要的权限 --&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.ACCESS_WIFI_STATE"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.ACCESS_COARSE_LOCATION"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.ACCESS_FINE_LOCATION"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.INTERNET"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.CHANGE_WIFI_STATE"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.CHANGE_WIFI_MULTICAST_STATE"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.ACCESS_NETWORK_STATE"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.WAKE_LOCK"</span> /&gt;</span></span><br></pre></td></tr></table></figure>
<h3 id="在Application-onCreate-中调用初始化"><a href="#在Application-onCreate-中调用初始化" class="headerlink" title="在Application onCreate()中调用初始化"></a>在Application onCreate()中调用初始化</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//初始化SDK</span></span><br><span class="line">IotKit.init(<span class="keyword">this</span>, <span class="string">"appSource"</span>, <span class="string">"developKey"</span>, <span class="string">"developSecret"</span>);</span><br><span class="line"><span class="comment">//是否打印日志，默认打开</span></span><br><span class="line">IotKit.isLoggable = <span class="keyword">false</span>;</span><br><span class="line"><span class="comment">//是否连接测试服务器，默认连接正式服务器</span></span><br><span class="line">IotKit.isTestServer = <span class="keyword">false</span>;</span><br></pre></td></tr></table></figure>
<h3 id="登陆小匠云服务"><a href="#登陆小匠云服务" class="headerlink" title="登陆小匠云服务"></a>登陆小匠云服务</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//登陆小匠云服务，userId 小匠云注册用户id，在登陆成功后才可以使用小匠云服务。</span></span><br><span class="line"><span class="comment">//需要第三方服务器对接小匠云用户中心，见服务端文档</span></span><br><span class="line">XJAccountManager.getInstance().login(String userId, AccountCallback callback);</span><br><span class="line"><span class="comment">//在注销或退出APP时需要退出小匠云服务</span></span><br><span class="line">XJAccountManager.getInstance().logout();</span><br></pre></td></tr></table></figure>
<h3 id="设备配网"><a href="#设备配网" class="headerlink" title="设备配网"></a>设备配网</h3><p>设备配网成功后获取到deviceId,调用绑定设备接口绑定设备，即可在设备列表接口获取到已绑定的设备。</p>
<blockquote>
<p>设备配网只支持2.4G wifi。</p>
</blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//开始配网</span></span><br><span class="line">XJWifiConfigManager.getInstance().startWifiConfig(<span class="keyword">this</span>, WifiConfigInfo, <span class="number">60</span>*<span class="number">1000</span>, <span class="keyword">new</span> WifiJoinCallback() &#123;</span><br><span class="line">            <span class="meta">@Override</span></span><br><span class="line">            <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onDeviceConnected</span><span class="params">()</span> </span>&#123;</span><br><span class="line">                <span class="comment">//设备联网成功</span></span><br><span class="line">            &#125;</span><br><span class="line">            <span class="meta">@Override</span></span><br><span class="line">            <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onJoinSucceed</span><span class="params">(String deviceId)</span> </span>&#123;</span><br><span class="line">                <span class="comment">//设备小匠云验证成功</span></span><br><span class="line">            &#125;</span><br><span class="line">            <span class="meta">@Override</span></span><br><span class="line">            <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onJoinFailed</span><span class="params">(String code, String errorMsg)</span> </span>&#123;</span><br><span class="line">                <span class="comment">//设备配网失败</span></span><br><span class="line">            &#125;</span><br><span class="line">        &#125;);</span><br><span class="line"><span class="comment">//停止配网</span></span><br><span class="line">XJWifiConfigManager.getInstance().stopWifiConfig();</span><br></pre></td></tr></table></figure>
<h3 id="小匠云API管理类XJApiManager，管理设备相关的http服务"><a href="#小匠云API管理类XJApiManager，管理设备相关的http服务" class="headerlink" title="小匠云API管理类XJApiManager，管理设备相关的http服务"></a>小匠云API管理类XJApiManager，管理设备相关的http服务</h3><p>示例：获取支持的产品列表</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">XJApiManager.getInstance().productList(<span class="keyword">new</span> ApiCallback&lt;List&lt;Product&gt;&gt;() &#123;</span><br><span class="line">                  <span class="meta">@Override</span></span><br><span class="line">                  <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onSuccess</span><span class="params">(List&lt;Product&gt; response)</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">                  &#125;</span><br><span class="line">                  <span class="meta">@Override</span></span><br><span class="line">                  <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onError</span><span class="params">(<span class="keyword">int</span> code, String msg)</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">                  &#125;</span><br><span class="line">              &#125;);</span><br></pre></td></tr></table></figure>
<p>更多：</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 修改设备昵称</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceNick</span><span class="params">(String deviceId, String nickname, ApiCallback&lt;DeviceNickRes&gt; callback)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 管理员用户修改绑定设备昵称</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceNickAdmin</span><span class="params">(String deviceId, String nickname, ApiCallback&lt;DeviceNickRes&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 解绑设备</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceUnbind</span><span class="params">(String productKey, String deviceId, ApiCallback&lt;DeviceUnbindRes&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 绑定设备(不设置昵称)</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceBind</span><span class="params">(String productKey, String deviceId, ApiCallback&lt;DeviceBindRes&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 绑定设备(设置昵称)</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceBind</span><span class="params">(String productKey, String deviceId, String nickname, ApiCallback&lt;DeviceBindRes&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 获取设备列表</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceList</span><span class="params">(ApiCallback&lt;List&lt;Device&gt;&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 获取设备详情</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceInfo</span><span class="params">(String deviceId, ApiCallback&lt;DeviceInfo&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 获取产品列表</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">productList</span><span class="params">(ApiCallback&lt;List&lt;Product&gt;&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 获取产品的详细信息</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">productInfo</span><span class="params">(String productKey, ApiCallback&lt;ProductInfo&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 获取设备的绑定用户信息</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceBindUsers</span><span class="params">(String deviceId, ApiCallback&lt;DeviceBindUsers&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 设备分享</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceShareSend</span><span class="params">(String productKey, String deviceId, ApiCallback&lt;DeviceShareSendRes&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 接收分享的设备</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceShareAccept</span><span class="params">(String qrcode, ApiCallback&lt;DeviceShareAcceptRes&gt; callBack)</span></span>;</span><br></pre></td></tr></table></figure>
<h3 id="小匠云设备数据管理类XJDataManager，管理设备相关的长连接通信服务"><a href="#小匠云设备数据管理类XJDataManager，管理设备相关的长连接通信服务" class="headerlink" title="小匠云设备数据管理类XJDataManager，管理设备相关的长连接通信服务"></a>小匠云设备数据管理类XJDataManager，管理设备相关的长连接通信服务</h3><p>示例：向设备发送开机</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">HashMap&lt;String, String&gt; hashMap = <span class="keyword">new</span> HashMap&lt;String, String&gt;();</span><br><span class="line"><span class="comment">//map key和value见协议文档</span></span><br><span class="line">hashMap.put(<span class="string">"PowerSwitch"</span>, <span class="string">"1"</span>);</span><br><span class="line">XJDataManager.getInstance().sendCmd(<span class="string">"productKey"</span>, <span class="string">"deviceId"</span>, hashMap,</span><br><span class="line">                        <span class="keyword">new</span> ActionCallback() &#123;</span><br><span class="line">                            <span class="meta">@Override</span></span><br><span class="line">                            <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onSuccess</span><span class="params">()</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">                            &#125;</span><br><span class="line">                            <span class="meta">@Override</span></span><br><span class="line">                            <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onFailure</span><span class="params">(String msg)</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">                            &#125;</span><br><span class="line">                        &#125;);</span><br></pre></td></tr></table></figure>
<p>更多：</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">  <span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 监听设备实时数据</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function"><span class="keyword">void</span> <span class="title">addDataCallback</span><span class="params">(DataCallback dataCallback)</span></span>;</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 移除设备实时数据监听</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function"><span class="keyword">void</span> <span class="title">removeDataCallback</span><span class="params">(DataCallback dataCallback)</span></span>;</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 移除所有设备实时数据监听</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function"><span class="keyword">void</span> <span class="title">removeAllDataCallback</span><span class="params">()</span></span>;</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 蓝牙设备数据上报</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function"><span class="keyword">void</span> <span class="title">bleDataPush</span><span class="params">(String productKey, String deviceId, HashMap&lt;String, String&gt; hashMap,</span></span></span><br><span class="line"><span class="function"><span class="params">                  ActionCallback callback)</span></span>;</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 向设备发送数据</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function"><span class="keyword">void</span> <span class="title">sendCmd</span><span class="params">(String productKey, String deviceId, HashMap&lt;String, String&gt; hashMap,</span></span></span><br><span class="line"><span class="function"><span class="params">              ActionCallback callback)</span></span>;</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 获取设备离线、在线状态</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function">String <span class="title">getOnlineStatus</span><span class="params">(String deviceId)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 获取设备 最新状态</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function">String <span class="title">getLatestStatus</span><span class="params">(String deviceId)</span></span>;</span><br></pre></td></tr></table></figure>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/04/11/小匠云平台物联网开发套件iotkit（Android）使用手册/" data-id="cjujetss500021lrjnv69vk4b" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
</article>


  
    <article id="post-hello-world" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/03/04/hello-world/" class="article-date">
  <time datetime="2019-03-04T13:53:45.150Z" itemprop="datePublished">2019-03-04</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/03/04/hello-world/">Hello World</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>Welcome to <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/" target="_blank" rel="noopener">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html" target="_blank" rel="noopener">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues" target="_blank" rel="noopener">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">"My New Post"</span></span><br></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/writing.html" target="_blank" rel="noopener">Writing</a></p>
<h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/server.html" target="_blank" rel="noopener">Server</a></p>
<h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/generating.html" target="_blank" rel="noopener">Generating</a></p>
<h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/deployment.html" target="_blank" rel="noopener">Deployment</a></p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/03/04/hello-world/" data-id="cjujesk2x00000hrjfhw6lpzt" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
</article>


  


</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/XJIOTKit/">XJIOTKit</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/iOS/">iOS</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/xjiang/">xjiang</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/使用文档/">使用文档</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/XJIOTKit/" style="font-size: 10px;">XJIOTKit</a> <a href="/tags/iOS/" style="font-size: 10px;">iOS</a> <a href="/tags/xjiang/" style="font-size: 10px;">xjiang</a> <a href="/tags/使用文档/" style="font-size: 10px;">使用文档</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">April 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/">March 2019</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2019/04/12/XJIOTKit-使用/">XJIOTKit 使用</a>
          </li>
        
          <li>
            <a href="/2019/04/11/新用户注册推送到中心/">新用户注册推送到中心</a>
          </li>
        
          <li>
            <a href="/2019/04/11/开发者账号秘钥验证，并获取token/">开发者账号秘钥验证，并获取token</a>
          </li>
        
          <li>
            <a href="/2019/04/11/小匠云平台物联网开发套件iotkit（Android）使用手册/">小匠云平台物联网开发套件iotkit（Android）使用手册</a>
          </li>
        
          <li>
            <a href="/2019/03/04/hello-world/">Hello World</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2019 zt.cfvli<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>



  </div>
</body>
</html>